﻿@using LunwenYun.Infrastructure.Entities.Entity;
@{
    Layout = "~/Views/Shared/_o_Main.cshtml";
    var user = (User)ViewBag.User;
    var agentInfo = (PaperAgentInfo)ViewBag.AgentInfo;
}
@section head{
    <script type="text/javascript" src="/Scripts/plug.js"></script>
}
<div class="container">
    <div class="row">
        <div class="span3">
            <ul class="nav nav-tabs nav-stacked">
                <li class="active"><a href="/o/authorcenter"><i class="icon-user"></i><strong>个人中心</strong></a></li>
                <li><a href="/o/authorcenter">约稿稿件</a></li> 
                <li><a href="/o/myorders">我的约稿 
                @if (ViewBag.OrderCount > 0)
                    {
                        <span class="badge badge-warning">@ViewBag.OrderCount</span>
                    }
                </a></li>
                @if (user.Industry > 0)
                {
                <li><a href="/o/industryorders">我的行业约稿</a></li>
                }
                <li class="active"><a href="/o/profile">约稿人信息</a></li>
                <li><a href="/o/resetpassword">修改密码</a></li>
            </ul>
        </div>
        <div class="span9">
            <blockquote>
                <p>
                    <strong>约稿人信息</strong></p>
                <small>请认真填写您的约稿人信息！</small>
            </blockquote>
            <hr />
            <form id="form1" action="/o/profile" method="post" class="form-horizontal">
                <input type="hidden" name="ret" value="@ViewBag.ReturnUrl" />
                    @if (!String.IsNullOrEmpty(ViewBag.Message))
                    {
                        if (ViewBag.Success)
                        {
                            <div class="alert alert-success">
							@ViewBag.Message
							<a href="javascript:;" data-dismiss="alert" class="close">×</a>
						    </div>
                        }
                        else
                        { 
                            <div class="alert alert-error">
							@ViewBag.Message
							<a href="javascript:;" data-dismiss="alert" class="close">×</a>
						    </div>
                        }
                    }
            <div class="control-group">
                <label class="control-label">
                    约稿联系邮箱 (*)
                </label>
                <div class="controls">
                    <input type="text" class="span4 {required:true,email:true}" name="Email" value="@agentInfo.Email" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    称谓 (*)
                </label>
                <div class="controls">
                    <input type="text" class="span4 {required:true}" name="Name" value="@agentInfo.Name" placeholder="请填写您的称谓" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    电 话 (*)
                </label>
                <div class="controls">
                    <input type="text" class="span4 {required:true,number:true,maxlength:20}" name="Phone" value="@agentInfo.Phone" placeholder="请填写联系电话" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    QQ号 (*)
                </label>
                <div class="controls">
                    <input type="text" class="span4 {required:true,number:true,minlength:5,maxlength:10}" name="QQ" value="@agentInfo.QQ" placeholder="请填QQ号以便约稿人最快的给您联系" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    约稿人简介 (*)
                </label>
                <div class="controls">
                    <textarea class="{required:true}" style="width:450px;height:200px;" name="Introduction">@agentInfo.Introduction</textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    约稿声明
                </label>
                <div class="controls">
                    <textarea style="width:450px;height:200px;" name="Declaration">@agentInfo.Declaration</textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    收款方式
                </label>
                <div class="controls">
                    <select name="AccountType">
                        <option value="1">财付通收款</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">
                    收款账号
                </label>
                <div class="controls">
                    <input type="text" class="span4" name="AccountNo" value="@agentInfo.AccountNo" placeholder="请认真填写收款账号，将用于资金结算使用" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <label class="checkbox">
                        <input type="checkbox" id="cbk" name="accept" checked="checked" class="{required:true}" />
                        <a target="_blank" href="/home/agentagreement">我已阅读并接受《约稿人协议》</a>
                    </label>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <input type="submit" value="提交" class="btn btn-info" style="width: 20%"/>
                </div>
            </div>
            </form>
            <hr />
        </div>
    </div>
</div>
@section tail
{
    <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#likcenter').addClass('active');
            $('#form1').validate({
                errorClass: "help-inline",
                errorElement: "span",
                highlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').addClass('error');
                },
                unhighlight: function (element, errorClass, validClass) {
                    $(element).parents('.control-group').removeClass('error');
                }
            });
        });
        function Refalsh(sender) {
            validation.Refalsh(sender);
        }
    </script>
}